<!DOCTYPE html>
<html>
<head>
    <title>维修工单管理</title>
    #parse("sys/header.html")
    <style>
        .urgeCss {
            background-color: #ffcc00;
        }

        .btShow {
            display: none;
        }

        .demo-upload-list {
            display: inline-block;
            width: 60px;
            height: 60px;
            text-align: center;
            line-height: 60px;
            border: 1px solid transparent;
            border-radius: 4px;
            overflow: hidden;
            background: #fff;
            position: relative;
            box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
            margin-right: 4px;
        }

        .demo-upload-list img {
            width: 100%;
            height: 100%;
        }

        .demo-upload-list-cover {
            display: none;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, .6);
        }

        .demo-upload-list:hover .demo-upload-list-cover {
            display: block;
        }

        .demo-upload-list-cover i {
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            margin: 0 2px;
        }

        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }

        .leftHeight {
            height: 85vh;
            overflow: auto;
        }

        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-thumb {
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }

        .workShop {
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            background-color: white;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.repairCode" @on-enter="query" placeholder="报修编号"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.devCode" @on-enter="query" placeholder="设备编码"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="设备名称"></i-input>
                </i-col>
                <i-col span="6">
                    <Date-picker type="daterange" v-model="repairStartRange" placement="bottom-end" placeholder="请选择维修开始查询起止时间" @on-change="handleRepairStartRangeChange"></Date-picker>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px">
            <div class="buttons-group">
                #if($shiro.hasPermission("devmaintenwork:export"))
                <i-button type="info" @click="exportData"><i class="fa fa-hand-o-up"></i>&nbsp;导出维修工单</i-button>
                <Upload ref="uploadFile"
                        action="../devmaintenwork/imports"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess" :on-error="handleError2"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="primary"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                #end
                #if($shiro.hasPermission("devmaintenwork:exception"))
                <i-button type="error" @click="exception"><i class="fa fa-trash-o"></i>异常上报</i-button>
                #end
                #if($shiro.hasPermission("devmaintenwork:orderSure"))
                <i-button type="success" @click="orderSure"><i class="fa fa-hand-o-right"></i>开始维修</i-button>
                #end
                #if($shiro.hasPermission("devmaintenwork:completed"))
                <i-button type="info" @click="completeRepair"><i class="fa fa-anchor"></i>&nbsp;结束维修</i-button>
                #end
                #if($shiro.hasPermission("devmaintenwork:startOrder"))
                <i-button type="warning" @click="addRepairRecord" icon="ios-skipforward">完善维修记录</i-button>
                #end
                #if($shiro.hasPermission("devmaintenwork:urge"))
                <i-button type="info" @click="urge"><i class="fa fa-hand-pointer-o"></i>催办</i-button>
                #end
                #if($shiro.hasPermission("devmaintenwork:check"))
                <i-button type="primary" @click="report"><i class="fa fa-pencil"></i>上报</i-button>
                #end
                <!--#if($shiro.hasPermission("devmaintenwork:lable"))
                <input type="hidden" id="shiroLable" name="lables" value="wx">
                #end-->
                <i-button type="success" @click="details"><i class="fa fa-eye"></i>查看</i-button>
                #if($shiro.hasPermission("devmaintenwork:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <Row :gutter="16" style="margin: 8px 0px 0px 1px;">
            <!-- 左侧设备组织树 -->
            <i-col :xs="3" :sm="3" :md="3" :lg="3">
                <div class="leftHeight">
                    <div class="workShop">
                        <p class="text-center" style="font-size: 15px;">工厂/基地</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="storeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table id="jqGrid"></table>
            </i-col>
        </Row>
    </div>
    <div id="select" style="display: none">
        <i-form>
            <Form-item label="主修人员" prop="repairUser">
                <i-col span="11">
                    <i-select v-model="devMaintenWork.repairUser" class="form-input" @on-change="carryClick">
                        <i-option v-for="item in repairUserList" :value="item.userId" :key="item.userId">
                            {{item.userName}}
                        </i-option>
                    </i-select>
                </i-col>
            </Form-item>
            <Form-item label="辅修人员" prop="planPerson">
                <Checkbox-group v-model="auxiliary">
                    <Checkbox v-for="item in planPerson" :label="item.userId" :key="item.userId">
                        <span>{{item.userName}}</span>
                    </Checkbox>
                </Checkbox-group>
            </Form-item>
        </i-form>
    </div>
    <!-- 上报人员选择列表 -->
    <div id="reportPersonList" style="display: none;margin: 20px">
        <i-form>
            <Form-item label="协助人员" prop="repairUser">
                <i-col span="11">
                    <i-select v-model="assistPersonId" class="form-input">
                        <i-option v-for="reportPerson in reportPersonList" :value="reportPerson.userId"
                                  :key="reportPerson.userId">
                            {{reportPerson.nickName}}
                        </i-option>
                    </i-select>
                </i-col>
            </Form-item>
        </i-form>
    </div>
</div>

<script src="${rc.contextPath}/js/device/devmaintenwork.js?_${date.systemTime}"></script>
</body>
</html>
